package org.example;

import org.testng.annotations.*;

public class TestConfig {

    @BeforeSuite
    public void beforeSuite(){
        System.out.println("测试套件（当前xml中<suite>标签）之前运行@BeforeSuite------");
    }

    @AfterSuite
    public void afterSuite(){
        System.out.println("测试套（当前xml中<suite>标签）之后运行@AfterSuite-------");
    }

    @BeforeTest
    public void beforeTest(){
        System.out.println("测试用例（当前xml中<test>标签）之前运行@BeforeTest");
    }

    @AfterTest
    public void afterTest(){
        System.out.println("测试用例（当前xml中<test>标签）之后运行@AfterTest--------");
    }

    @BeforeMethod
    public void beforeMethod(){
        System.out.println("当前类每个测试方法（@Test）之前运行@BeforeMethod");
    }

    @AfterMethod
    public void afterMethod(){
        System.out.println("当前类每个测试方法（@Test）之后运行@AfterMethod");
    }

    @BeforeGroups(value="group1")
    public void beforeGroups(){
        System.out.println("配置组配group1之前运行@BeforeGroups..........");
    }

    @AfterGroups(value="group1")
    public void afterGroups(){
        System.out.println("配置组配group1之前运行@AfterGroups.......");
    }

    @Test
    public void test1(){
        System.out.println("running TestConfig.test1()");
    }

    @Test
    public void test2(){
        System.out.println("running TestConfig.test2()");
    }

    @Test(groups = "demo-1")
    public void test3(){
        System.out.println("running TestConfig.test3()");
    }
}

